package com.gxa.controller;

import com.gxa.pojo.Share;
import com.gxa.utils.Constants;
import com.gxa.utils.ResponseData;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * User: tx
 * Date: 2020/11/26 17:32
 * Description:
 * Version: V1.0
 */
@RestController
@Api(value = "分享记录",tags = "分享记录")
@RequestMapping(value = "options")
public class RecordController {


    @Autowired
    private ResponseData responseData;
    @Autowired(required = false)
    private Constants constants;


    @GetMapping("/delRecord")
    @ApiOperation(value = "删除分享记录",notes = "根据提交的信息删除分享记录",httpMethod = "GET",response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "删除成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "删除失败")
    })
    public ResponseData delRecord(@ApiParam(name = "dasId",value = "分享记录",required = true) int wechatMid){
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("删除成功");
        responseData.setData(wechatMid);
        return responseData;
    }




    @GetMapping("/delRecordAll")
    @ApiOperation(value = "删除分享记录",notes = "根据提交的信息删除分享记录单",httpMethod = "GET",response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "删除成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "删除失败")
    })
    public ResponseData delRecordAll(@ApiParam(name = "modId",value = "分享记录",required = true) int wechatMid){
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("删除成功");
        responseData.setData(wechatMid);
        return responseData;
    }



    @PostMapping("/queryRecord")
    @ApiOperation(value = "查询分享记录",notes = "根据提交的信息查询分享记录",httpMethod = "POST",response = ResponseData.class)
    @ApiResponses({
            @ApiResponse(code = 200, message = "查询成功"),
            @ApiResponse(code = 400, message = "找不到页面"),
            @ApiResponse(code = 500, message = "查询失败")
    })
    public ResponseData queryRecord(@ApiParam(name = "share",value = "分享记录",required = true) Share share){
        share.setShareClass("类型1");
        share.setShareLink("daksjhgfyqwegf");
        share.setShareStatu(1);
        responseData.setCode(Constants.SUCCESS);
        responseData.setMsg("查询成功");
        responseData.setData(share);
        return responseData;
    }
}
